<HTML>
<HEAD>
<TITLE>g_cluster</TITLE>
<LINK rel=stylesheet href="style.css" type="text/css">
<BODY text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#990000" alink="#FF0000">
<TABLE WIDTH="98%" NOBORDER >
<TR><TD WIDTH=400>
<TABLE WIDTH=400 NOBORDER>
<TD WIDTH=116>
<a href="http://www.gromacs.org/"><img SRC="../images/gmxlogo_small.png"BORDER=0 </a></td>
<td ALIGN=LEFT VALIGN=TOP WIDTH=280><br><h2>g_cluster</h2><font size=-1><A HREF="../online.html">Main Table of Contents</A></font><br><br></td>
</TABLE></TD><TD WIDTH="*" ALIGN=RIGHT VALIGN=BOTTOM><p><B>VERSION 4.5<br>
Thu 26 Aug 2010</B></td></tr></TABLE>
<HR>
<H3>Description</H3>
<p>
g_cluster can cluster structures with several different methods.
Distances between structures can be determined from a trajectory
or read from an XPM matrix file with the <tt>-dm</tt> option.
RMS deviation after fitting or RMS deviation of atom-pair distances
can be used to define the distance between structures.<p>
single linkage: add a structure to a cluster when its distance to any
element of the cluster is less than <tt>cutoff</tt>.<p>
Jarvis Patrick: add a structure to a cluster when this structure
and a structure in the cluster have each other as neighbors and
they have a least <tt>P</tt> neighbors in common. The neighbors
of a structure are the M closest structures or all structures within
<tt>cutoff</tt>.<p>
Monte Carlo: reorder the RMSD matrix using Monte Carlo.<p>
diagonalization: diagonalize the RMSD matrix.<p>
gromos: use algorithm as described in Daura <it>et al.</it>
(<it>Angew. Chem. Int. Ed.</it> <b>1999</b>, <it>38</it>, pp 236-240).
Count number of neighbors using cut-off, take structure with
largest number of neighbors with all its neighbors as cluster
and eleminate it from the pool of clusters. Repeat for remaining
structures in pool.<p>
When the clustering algorithm assigns each structure to exactly one
cluster (single linkage, Jarvis Patrick and gromos) and a trajectory
file is supplied, the structure with
the smallest average distance to the others or the average structure
or all structures for each cluster will be written to a trajectory
file. When writing all structures, separate numbered files are made
for each cluster.<p>
Two output files are always written:<br>
<tt>-o</tt> writes the RMSD values in the upper left half of the matrix
and a graphical depiction of the clusters in the lower right half
When <tt>-minstruct</tt> = 1 the graphical depiction is black
when two structures are in the same cluster.
When <tt>-minstruct</tt> &gt; 1 different colors will be used for each
cluster.<br>
<tt>-g</tt> writes information on the options used and a detailed list
of all clusters and their members.<p>
Additionally, a number of optional output files can be written:<br>
<tt>-dist</tt> writes the RMSD distribution.<br>
<tt>-ev</tt> writes the eigenvectors of the RMSD matrix
diagonalization.<br>
<tt>-sz</tt> writes the cluster sizes.<br>
<tt>-tr</tt> writes a matrix of the number transitions between
cluster pairs.<br>
<tt>-ntr</tt> writes the total number of transitions to or from
each cluster.<br>
<tt>-clid</tt> writes the cluster number as a function of time.<br>
<tt>-cl</tt> writes average (with option <tt>-av</tt>) or central
structure of each cluster or writes numbered files with cluster members
for a selected set of clusters (with option <tt>-wcl</tt>, depends on
<tt>-nst</tt> and <tt>-rmsmin</tt>).<br>
<P>
<H3>Files</H3>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2>
<TR><TH>option</TH><TH>filename</TH><TH>type</TH><TH>description</TH></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-f</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="files.html">    traj.xtc</a></tt> </TD><TD> Input, Opt. </TD><TD> Trajectory: <a href="xtc.html">xtc</a> <a href="trr.html">trr</a> <a href="trj.html">trj</a> <a href="gro.html">gro</a> <a href="g96.html">g96</a> <a href="pdb.html">pdb</a> cpt </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-s</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="files.html">   topol.tpr</a></tt> </TD><TD> Input, Opt. </TD><TD> Structure+mass(db): <a href="tpr.html">tpr</a> <a href="tpb.html">tpb</a> <a href="tpa.html">tpa</a> <a href="gro.html">gro</a> <a href="g96.html">g96</a> <a href="pdb.html">pdb</a> </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-n</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="ndx.html">   index.ndx</a></tt> </TD><TD> Input, Opt. </TD><TD> Index file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-dm</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xpm.html">    rmsd.xpm</a></tt> </TD><TD> Input, Opt. </TD><TD> X PixMap compatible matrix file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-o</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xpm.html">rmsd-clust.xpm</a></tt> </TD><TD> Output </TD><TD> X PixMap compatible matrix file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-g</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="log.html"> cluster.log</a></tt> </TD><TD> Output </TD><TD> Log file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-dist</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">rmsd-dist.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-ev</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">rmsd-eig.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-sz</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">clust-size.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-tr</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xpm.html">clust-trans.xpm</a></tt> </TD><TD> Output, Opt. </TD><TD> X PixMap compatible matrix file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-ntr</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">clust-trans.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-clid</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">clust-id.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-cl</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="files.html">clusters.pdb</a></tt> </TD><TD> Output, Opt. </TD><TD> Trajectory: <a href="xtc.html">xtc</a> <a href="trr.html">trr</a> <a href="trj.html">trj</a> <a href="gro.html">gro</a> <a href="g96.html">g96</a> <a href="pdb.html">pdb</a> cpt </TD></TR>
</TABLE>
<P>
<H3>Other options</H3>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2>
<TR><TH>option</TH><TH>type</TH><TH>default</TH><TH>description</TH></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]h</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Print help info and quit </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]version</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Print version info and quit </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-nice</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>19</tt> </TD><TD> Set the nicelevel </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-b</tt></b> </TD><TD ALIGN=RIGHT> time </TD><TD ALIGN=RIGHT> <tt>0     </tt> </TD><TD> First frame (ps) to read from trajectory </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-e</tt></b> </TD><TD ALIGN=RIGHT> time </TD><TD ALIGN=RIGHT> <tt>0     </tt> </TD><TD> Last frame (ps) to read from trajectory </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-dt</tt></b> </TD><TD ALIGN=RIGHT> time </TD><TD ALIGN=RIGHT> <tt>0     </tt> </TD><TD> Only use frame when t MOD dt = first time (ps) </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-tu</tt></b> </TD><TD ALIGN=RIGHT> enum </TD><TD ALIGN=RIGHT> <tt>ps</tt> </TD><TD> Time unit: <tt>fs</tt>, <tt>ps</tt>, <tt>ns</tt>, <tt>us</tt>, <tt>ms</tt> or <tt>s</tt> </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]w</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> View output <a href="xvg.html">xvg</a>, <a href="xpm.html">xpm</a>, <a href="eps.html">eps</a> and <a href="pdb.html">pdb</a> files </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-xvg</tt></b> </TD><TD ALIGN=RIGHT> enum </TD><TD ALIGN=RIGHT> <tt>xmgrace</tt> </TD><TD> <a href="xvg.html">xvg</a> plot formatting: <tt>xmgrace</tt>, <tt>xmgr</tt> or <tt>none</tt> </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]dista</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Use RMSD of distances instead of RMS deviation </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-nlevels</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>40</tt> </TD><TD> Discretize RMSD matrix in # levels </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-cutoff</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>0.1   </tt> </TD><TD> RMSD cut-off (nm) for two structures to be neighbor </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]fit</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>yes   </tt> </TD><TD> Use least squares fitting before RMSD calculation </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-max</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>-1    </tt> </TD><TD> Maximum level in RMSD matrix </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-skip</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>1</tt> </TD><TD> Only analyze every nr-th frame </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]av</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Write average iso middle structure for each cluster </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-wcl</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>0</tt> </TD><TD> Write all structures for first # clusters to numbered files </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-nst</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>1</tt> </TD><TD> Only write all structures if more than # per cluster </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-rmsmin</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>0     </tt> </TD><TD> minimum rms difference with rest of cluster for writing structures </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-method</tt></b> </TD><TD ALIGN=RIGHT> enum </TD><TD ALIGN=RIGHT> <tt>linkage</tt> </TD><TD> Method for cluster determination: <tt>linkage</tt>, <tt>jarvis-patrick</tt>, <tt>monte-carlo</tt>, <tt>diagonalization</tt> or <tt>gromos</tt> </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-minstruct</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>1</tt> </TD><TD> Minimum number of structures in cluster for coloring in the <a href="xpm.html">xpm</a> file </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]binary</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Treat the RMSD matrix as consisting of 0 and 1, where the cut-off is given by -cutoff </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-M</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>10</tt> </TD><TD> Number of nearest neighbors considered for Jarvis-Patrick algorithm, 0 is use cutoff </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-P</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>3</tt> </TD><TD> Number of identical nearest neighbors required to form a cluster </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-seed</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>1993</tt> </TD><TD> Random number seed for Monte Carlo clustering algorithm </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-niter</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>10000</tt> </TD><TD> Number of iterations for MC </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-kT</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>0.001 </tt> </TD><TD> Boltzmann weighting factor for Monte Carlo optimization (zero turns off uphill steps) </TD></TD>
</TABLE>
<P>
<hr>
<div ALIGN=RIGHT>
<font size="-1"><a href="http://www.gromacs.org">http://www.gromacs.org</a></font><br>
<font size="-1"><a href="mailto:gromacs@gromacs.org">gromacs@gromacs.org</a></font><br>
</div>
</BODY>
